package com.lbx.mapper;

import com.lbx.entity.User;
import org.mybatis.spring.support.SqlSessionDaoSupport;

/**
 * @author 吕兵星
 * @date 2020/10/22 15:32
 */
public class UserMapperImpl extends SqlSessionDaoSupport implements UserMapper {
    @Override
    public int addOne(User user) {
        return getSqlSession().getMapper(UserMapper.class).addOne(user);
    }

    @Override
    public int deleteOne(int id) {
        return getSqlSession().getMapper(UserMapper.class).deleteOne(id);

    }

    @Override
    public User selectOne(int id) {
        User user = new User();
        user.setId(3);
        user.setUname("peiQi");
        user.setPwd("123456789");
        addOne(user);
        deleteOne(3);
        return getSqlSession().getMapper(UserMapper.class).selectOne(id);

    }

}
